//
//  ZCeatweeklyCell.m
//  zctx
//
//  Created by apple on 16/1/20.
//  Copyright © 2016年 sanliang. All rights reserved.
//

#import "ZCeatweeklyCell.h"

@implementation ZCeatweeklyCell

- (void)awakeFromNib {
    // Initialization code
    
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.ImgView.layer.cornerRadius = 5;
    self.ImgView.layer.masksToBounds = YES;
    
    self.titleLable.textColor = [UIColor colorWithHexString:@"#404040"];
    self.timeLable.textColor = [UIColor colorWithHexString:@"#8a8a8a"];
    self.commentLable.textColor = [UIColor colorWithHexString:@"#8a8a8a"];
}

-(void)setContentDict:(NSDictionary *)contentDict{
    _contentDict = contentDict;
    NSString *time = [NSString stringWithFormat:@"%@",[contentDict objectForKey:@"ctime"]];
    NSString *commnet_count = [NSString stringWithFormat:@"%@",[contentDict objectForKey:@"comment_count"]];
    NSString *thumb = [NSString stringWithFormat:@"%@",[contentDict objectForKey:@"thumb"]];
    
    self.titleLable.text = [NSString stringWithFormat:@"%@",[contentDict objectForKey:@"title"]];
    int timeInt =[time intValue];
    self.timeLable.text = [NSString stringWithFormat:@"%@",dateTimeWithNString(timeInt)];

    
    if ([commnet_count integerValue]>99) {
        self.commentLable.text = [NSString stringWithFormat:@"99+"];
    }else{
        self.commentLable.text = commnet_count;
    }
    NSString *imageStr =[NSString stringWithFormat:@"%@%@",[NetworkManager strURLBasic],thumb];
    if (imageStr.length>0) {
        [self.ImgView sd_setImageWithURL:[NSURL URLWithString:imageStr] placeholderImage:[UIImage imageNamed:@"placehold_weekly"]];
    }else{
        self.ImgView.image = [UIImage imageNamed:@"placehold_weekly"];
    }

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
